home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / FTAG3.422 < prev    next >
Text File  |  1993-04-16  |  7KB  |  251 lines

  1. Third and final part (FTAG.422)
  2. Commander Riker #1 @7751
  3. 3Saturday, April 10, 1993  1 6:52 am
  4. ═══[ Step 8        ]═══════════════════════════════════════════════════════
  5.  
  6. Insert the following procedures in xfer.c or xferovl.c it doesn't matter,
  7. the only difference is one is overlaied one isn't.... (no dah!)
  8.  
  9. /************* [Block copy from til I say STOP!] ***************/
  10.  
  11. char onek2(char *s)
  12. {
  13.   char ch;
  14.  
  15.   while (!strchr(s, ch = upcase(getkey())) && !hangup)
  16.     ;
  17.   if (hangup)
  18.     ch = s[0];
  19.   if (ch!=13)
  20.      outchr(ch);
  21.   return(ch);
  22. }
  23.  
  24. void backline(void)
  25. {
  26.  int i;
  27.  
  28.  ansic(0);
  29.  outchr(32);
  30.   for(i=wherex(); i>0; i--)
  31.      backspace();
  32. }
  33.  
  34. void tag_files(void)
  35. {
  36.  int i, done=0, had, fp, oh;
  37.  char s[161],s1[161],s2[81];
  38.  double t;
  39.  long fs;
  40.  
  41.   if (x_only) {
  42.      file_ptr=0;
  43.      return;
  44.   }
  45.   if (in_tag==2) {
  46.      file_ptr=0;
  47.      return;
  48.   }
  49.   if (thisuser.sysstatus&sysstatus_no_tag) {
  50.      if (thisuser.sysstatus&sysstatus_pause_on_page)
  51.          pausescr();
  52.      file_ptr=0;
  53.      return;
  54.   }
  55.  
  56.   oh=helpl;
  57.   helpl=43;
  58.   while ((!done) && (!hangup)) {
  59.     sprintf(s2,"(%s)-(%s) :",udir[curdir].keys,directories[udir[curdir].subnum].name);
  60.   prt(2,s2);
  61.    prt(2,"C)ontinue T)ag D)ownload V)iew S)top N)on-stop? "); /* Ver 2.2 */
  62.    switch (onek2("CTDVSN \r")) {
  63.       case 'S':
  64.          in_tag=3;
  65.          done=1;
  66.          break;
  67.       case 'N':
  68.          in_tag=2;
  69.          done=1;
  70.          break;
  71.       case 'T':
  72.         if (numbatch>=MAX_BATCH) {
  73.             backline();
  74.             prt(6,"No room left in batch queue.");
  75.             getkey();
  76.             backline();
  77.             break;
  78.          }
  79.          backline();
  80.          npr("Tag which file? ");
  81.          mpl(2);
  82.          input1(s,2,0,0);
  83.          i=atoi(s)-1;
  84.          if ((s[0]) && (i>=0) && (i<MAX_FILES) && (i<file_ptr)) {
  85.              if (check_batch_queue(file_index[i].filename)) {
  86.                 backline();
  87.                 prt(6,"That file is already in the batch queue.");
  88.                 getkey();
  89.                 backline();
  90.                 break;
  91.              }
  92.              sprintf(s,"%s%s",directories[file_index[i].directory].path,
  93.                        stripfn(file_index[i].filename));
  94.              fp=open(s,O_RDONLY | O_BINARY);
  95.              if (fp<0) {
  96.                    backline();
  97.                    prt(6,"File not there.");
  98.                    getkey();
  99.                    backline();
  100.                    break;
  101.              }
  102.              fs=filelength(fp);
  103.              close(fp);
  104.  
  105.              t=(12.656) / ((double) (modem_speed)) * ((double)(fs));
  106.              if (nsl()<=(batchtime + t)) {
  107.                    backline();
  108.                    prt(6,"Not enough time left in queue.");
  109.                    getkey();
  110.                    backline();
  111.                    break;
  112.               } else {
  113.                    batchtime += t;
  114.                    strcpy(batch[numbatch].filename,file_index[i].filename);
  115.                    batch[numbatch].dir=file_index[i].directory;
  116.                    batch[numbatch].time=t;
  117.                    batch[numbatch].sending=1;
  118.                    batch[numbatch].len=fs;
  119.  
  120.                    numbatch++;
  121.                    ++numbatchdl;
  122.                    backline();
  123.                    prt(1,"File added to batch queue.");
  124.                    getkey();
  125.                    backline();
  126.                 }
  127.          } else
  128.             backline();
  129.          break;
  130.       case 'D':
  131.          if (numbatchdl==0) {
  132.            backline();
  133.            prt(6,"Nothing in batch download queue.");
  134.            getkey();
  135.            backline();
  136.            break;
  137.          }
  138.          if (!ratio_ok()) {
  139.              backline();
  140.              prt(6,"Sorry, your ratio is too low.");
  141.              getkey();
  142.              backline();
  143.              break;
  144.          }
  145.  
  146.          nl();
  147.          listbatch();
  148.          nl();
  149.          prt(5,"Hang up after transfer? ");
  150.          had=yn();
  151.          nl();
  152.  
  153.          i=get_protocol(xf_down_batch);
  154.          if (i>0) {
  155.  
  156.           if (i==4)
  157.             ymbatchdl(had);
  158.            else
  159.              dszbatchdl(had,externs[i-6].sendbatchfn,externs[i-6].description);
  160.  
  161.            if (!had) {
  162.              nl();
  163.              npr("Your ratio is now: %-6.3f",ratio());
  164.              nl();
  165.            }
  166.          }
  167.          nl();
  168.          pausescr();
  169.          done=1;
  170.          break;
  171.       case 'V':
  172.          backline();
  173.          npr("View which file? ");
  174.          mpl(2);
  175.          input1(s,2,0,0);
  176.          i=atoi(s)-1;
  177.          if ((s[0]) && (i>=0) && (i<MAX_FILES) && (i<file_ptr)) {
  178.             sprintf(s1,"%s%s",directories[file_index[i].directory].path,
  179.                        stripfn(file_index[i].filename));             
  180.             if (!exist(s1)) {
  181.                backline();
  182.                prt(6,"File not there.");
  183.                getkey();
  184.                backline();
  185.                break;
  186.             }
  187.             get_arc_cmd(s,s1,0,"");
  188.             if (!okfn(stripfn(file_index[i].filename)))
  189.                s[0]=0;
  190.             if (s[0]!=0) {
  191.                nl();
  192.                in_tag=0;
  193.                do_external(s,1);
  194.                nl();
  195.                pausescr();
  196.                outstr("\f");
  197.                in_tag=1;
  198.                done=1;
  199.             } else {
  200.                 backline();
  201.                 prt(6,"Unknown archive.");
  202.                 getkey();
  203.                 backline();
  204.                 break;
  205.             }
  206.          } else
  207.             backline();
  208.          break;
  209.       default:
  210.          done=1;
  211.          outstr("\f");        /* FTAG422 NOTE */
  212.          break;
  213.    }
  214.   }
  215.   backline();
  216.   helpl=oh;
  217.   file_ptr=0;
  218. }
  219.  
  220. /**************[STOP!!!!!!]*******************/
  221.  
  222. /* NOTE */ ---- This line can be removed if you do not want it to clear
  223. the screen each time it completes searching a section. This will not
  224. effect how the mod works at all. I is meerly cosmetic.
  225.  
  226.  
  227. This one is easy run "MAKE FCNS" and let it do the work... else if your
  228. makeafobic just add the previous functions' declarations in fcns.h.
  229.  
  230.  
  231. char onek2(char *s);  /* FT422 */
  232. void backline(void);  /* FT422 */
  233. void tag_files(void);  /* FT422 */
  234.  
  235.  
  236. ═══[ Step 10       ]═══════════════════════════════════════════════════════
  237.  
  238. Due to the fact that you have modified the header files, I got some bad
  239. news for you! Time for a complete re-compile! Type make and take in a
  240. movie and dinner.
  241.  
  242.  
  243.  
  244. CLOSING:
  245.   If you have any problems with this mod, let me know. My address is as
  246. follows.
  247.  
  248. Commander Riker / 1@7751 IceNET
  249. Starfleet Command [ISB/ASV]
  250. [717] 298-2131
  251.